<!--_meta 作为公共模版分离出去-->
{include file="public/header"}
<!--/meta 作为公共模版分离出去-->

<title>账户列表</title>
<meta name="keywords" content="">
<meta name="description" content="">
<link rel="stylesheet" href="/static/page/page.css">
</head>
<body>
<div class="wap-container">
    <nav class="breadcrumb" style="background-color:#fff;padding: 0 24px">
        首页
        <span class="c-gray en">/</span>
        运营账户
        <span class="c-gray en">/</span>
        账户管理
        <a class="btn btn-success radius f-r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
    </nav>

    <article class="Hui-admin-content clearfix">

        <div class="panel mt-20">
            <div class="panel-body">
                <div class="clearfix">
                    <a href="javascript:;" onclick="export_data()" class="btn btn-secondary radius"> 导出EXCEl</a>
                    <span class="f-r">共有数据：<strong>{$order.total}</strong> 条</span>
                </div>
                <div class="mt-20 clearfix">
                    <table class="table table-border table-bordered table-bg table-hover table-sort">
                        <thead>
                        <tr>
                            <th scope="col" colspan="10">订单列表</th>
                        </tr>
                        <tr class="text-c">
                            <th width="40"><input name="" type="checkbox" value=""></th>
                            <th width="120">订单号</th>
                            <th width="40">订单类型</th>
                            <th width="90">下单时间</th>
                            <th width="80">订单状态</th>
                            <th width="80">售后状态</th>
<!--                            <th width="100">收货人手机号</th>-->
<!--                            <th width="100">收货地址</th>-->
                            <th width="80">支付状态</th>
<!--                            <th width="100">发货状态</th>-->
                            <th width="100">订单总额</th>
                            <th width="100">订单来源</th>
<!--                            <th width="100">支付状态</th>-->
<!--                            <th width="100">操作</th>-->
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="order['data']" id="vo"}
                        <tr class="text-c">
                            <td><input name="" type="checkbox" value="{$vo.order_id}"></td>
                            <td>{$vo.order_id}</td>
                            <td>
                                {switch $vo.order_type}
                                    {case 1}普通订单{/case}
                                    {case 2}拼团订单{/case}
                                    {default /}
                                {/switch}
                            </td>
                            <td>{$vo.ctime | date="Y-m-d"}</td>
                            <td>
                                {switch $vo.status}
                                    {case 1}正常{/case}
                                    {case 2}完成{/case}
                                    {case 3}取消{/case}
                                    {default /}
                                {/switch}
                            </td>
                            <td>
                                {switch $vo.confirm}
                                    {case 1}未确认收货{/case}
                                    {case 2}已确认收货{/case}
                                    {default /}
                                {/switch}
                            </td>
                            <td>
                                {switch $vo.pay_status}
                                    {case 1}未付款{/case}
                                    {case 2}已付款{/case}
                                    {case 3}部分付款{/case}
                                    {case 4}部分退款{/case}
                                    {case 5}已退款{/case}
                                    {default /}
                                {/switch}
                            </td>
                            <td>{$vo.goods_amount}</td>
                            <td>
                                {switch $vo.source}
                                {case 1}PC页面{/case}
                                {case 2}H5页面{/case}
                                {case 3}微信小程序{/case}
                                {default /}
                                {/switch}
                            </td>
<!--                            <td>-->
<!--                                -->
<!--                            </td>-->
<!--                            <td class="td-manage">-->
<!--                                <a title="删除" href="javascript:;" onclick="admin_del(this,'{$vo.order_id}')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a>-->
<!--                            </td>-->
                        </tr>
                        {/volist}

                        </tbody>
                    </table>
                    <div class="paginate">{$page|raw}</div>
                </div>
            </div>
        </div>
    </article>
</div>
<!--
class="td-status"
<span class="label label-success radius">已启用</span>

                                <span class="label radius">已停用</span>
-->
<!--_footer 作为公共模版分离出去-->
{include file="public/footer"}
<!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/static/admin/lib/datatables/1.10.15/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/static/admin/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="/static/admin/static/business/js/main.js"></script>
<script type="text/javascript">
    $(function(){
        runDatetimePicker();
        // 全选 页面调用
        $(".table").HuicheckAll(
            {
                checkboxAll: 'thead input[type="checkbox"]',
                checkbox: 'tbody input[type="checkbox"]'
            },
            function(checkedInfo) {
                console.log(checkedInfo);
            }
        )
    });

    // 删除
    function admin_del(obj,id){
        layer.confirm('确认要删除吗？',function(index){
            $.post("{:url('delete')}",{id:id},function(data){
                if(data.code == 200){
                    $(obj).parents("tr").remove();
                    layer.msg(data.msg,{icon:1,time:1000});
                }else{
                    layer.msg(data.msg,{icon:1,time:1000});
                }
            });
        });
    }
</script>
<script>
    /*导出数据*/
    function export_data(){
        var str = '';
        var arr = [];
        $('input[type="checkbox"]:checked').each(function(){
            str += $(this).val()+',';
            var id = $(this).val();
            arr.push(id);
        });
        if(arr.length<1){
            layer.msg('选项不能为空',{icon:2,time:2000});
            return false;
        }
        // console.log(arr);
        $.post('/operater/operation/orderDownload',{arr:arr},function(data){
            if(data > 0){
                layer.confirm('确认要生成excel文件并下载',function(index){
                    window.location.href='/operater/operation/download/id/'+data;
                    layer.msg('已经执行!',{icon: 6,time:1000});
                });
            }
        });
    }
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
